﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JSUserDWFApplyList.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.JSDWF.JSUserDWFApplyList" %>
<%--图纸DWF申请--%>
<div class="pageContent JSUserDWFApplyList" style="padding:5px">		   
        <table width="100%" border="0" cellpadding="0" cellspacing="0" >
            <tr>
                <td valign="top" style="width:185px; layoutH="12">  
                    <div style="width:180px; border:solid 1px #CCC; line-height:21px; background:#fff" layoutH="12">          
			            <ul class="tree treeFolder">
				            <li>
                                <a  href="JSDWF/JSUserDWFApplyFolderList.aspx" target="ajax" rel="JSUserDWFApplyListDWFjbsxBox"  defautloadajax="true">所有图纸目录</a>					
                                <%=GetFolderTree(0) %>
				            </li>						
			            </ul>	
                    </div> 	                      
                </td>
                <td   valign="top"   >                   
		             <div id="JSUserDWFApplyListDWFjbsxBox" layoutH="12" valign="top"  style="border:solid 1px #CCC; background:#fff">
                        DWF分类图纸	
                      </div>	            
                </td>
                <td valign="top"  layoutH="12" style=" width:185px; border-width:1px 1px 1px 0px; border-style:solid ; border-color: #CCC; line-height:21px; background:#fff" >
                     <div  id="JSUserDWFApplyListViewjbsxBox"  style="height:200px; border-bottom:solid 1px #CCC; line-height:21px; "  >
                        可在线显示您已申请的DWF图纸(点操作中的查看可显示)
                     </div>
                     <div  id="JSUserDWFApplyListSelectjbsxBox"  style=" margin-top:5px; border-top:solid 1px #CCC; line-height:21px; background:#fff" layoutH="220">
		                <form method="post" id="JSUserDWFApplySelectForm" action="JSDWF/JSUserDWFApplyList.aspx?ajaxmethod=apply" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);" >
                            <div class="pageContent">
                            <div class="pageFormContent" layoutH="245" style="padding:0px!important;">
                                <div style=" line-height:21px; border-bottom:1px solid #ccc;">需使用的图纸(点操作中的申请)</div>
                                <table id="JSUserDWFApplySelectListDT" width="100%" class="list">
                                    <thead><tr><th>图纸名称</th><th>删除</th></tr></thead>
                                    <tbody>
                               
                                    </tbody>
                                </table>
                                
                            </div>
                            <div style="text-align:right; float:right; padding:0 5px;" >
			                    <div>
                                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td width="115">
                                            <input type="hidden" id="JSUserDWFApplySelectFormAdtlvlID" name="AdtlvlID" value="0" />
                                            <input type="text" id="JSUserDWFApplySelectFormremark" name="remark"  title="请输入用途" class="required" style="width:120px" />
                                            </td>
                                            <td width="70"><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="sureapply()" >申请</button></div></div></td>
                                        </tr>
                                    </table>
                                </div>
		                    </div>
                            </div>
                        </form>
		             </div>
                    
                </td>
            </tr>
        </table>
	
</div>

<script>
    var _selectdwflist = "";
    function JSUserDWFApplySelect_OnClick(dwfid, dwffilename, AdtlvlID) {
        var pos = _selectdwflist.lastIndexOf(dwfid);
        //alert(pos);
        if (pos >= 0)
            return;
        else
            _selectdwflist += dwfid + ',';

        //权重对比       
        var $JSUserDWFApplySelectFormAdtlvlID = $("#JSUserDWFApplySelectFormAdtlvlID");
        if (parseInt(AdtlvlID) > parseInt($JSUserDWFApplySelectFormAdtlvlID.val())) {
            $JSUserDWFApplySelectFormAdtlvlID.val(AdtlvlID);
        }


        var $tbody = $("#JSUserDWFApplySelectListDT").find("tbody");
        $tbody.append("<tr><td><input name='dwfid' type='hidden' class='dwfid' value='" + dwfid + "'>" + dwffilename + "</td><td><a class='remove' href='#'>删</a></td></tr>").find(".remove").click(function () {
            var _dwfid = $(this).closest("tr").find(".dwfid").val();
            _selectdwflist=_selectdwflist.replace(_dwfid + ',', "");
            $(this).closest("tr").remove();
        });
    }


    function sureapply() {
        var $tbody = $("#JSUserDWFApplySelectListDT").find("tbody");
        if ($tbody.find("tr").size() <= 0) {
            alertMsg.warn('请先选择要申请的图纸，再提交！')
            return;
        }

        if ($.trim($("#JSUserDWFApplySelectFormremark").val()) == "") {
            alertMsg.warn('请输入您的申请用途，再提交！');
            $("#JSUserDWFApplySelectFormremark").focus();
            return;
        }
        var infomsg = "";
        $.ajax({
            type: 'get',
            url: 'JSDWF/JSUserDWFApplyList.aspx?ajaxmethod=getAdtlvlinfo&AdtlvlID=' + $("#JSUserDWFApplySelectFormAdtlvlID").val(),
           // dataType: "text",
            async: false,
            cache: false,
            success: function (json) {
                try {
                    infomsg=json
                }
                catch (e) {

                }
            }
        });


        alertMsg.confirm(infomsg, {
            okCall: function () {                
                $("#JSUserDWFApplySelectForm").submit();
            }
        });
    }
</script>
<style>
    .JSUserDWFApplyList a{ cursor:pointer;}
</style>